package com.qfedu.smart_community.ex;

import com.qfedu.smart_community.vo.AjaxVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @version v1.0
 * @Date 2023/10/19 17:41
 * @Author DARKER
 * @Email 1402216045@qq.com
 */
@ControllerAdvice
public class GlobalExceptionHandler {
    @ResponseBody
    @ExceptionHandler(Exception.class)
    public AjaxVO handException(RuntimeException ex){

        return AjaxVO.create().setCode(-1).setMsg(ex.getMessage());

    }

}
